import { AsyncComponentLoader, FunctionalComponent } from 'vue';

export interface Layout {
  [key: string]: number;
}

export interface Node {
  id: string;
  name: string;
  label: string;
  model?: any;
  icon?: string;
  component?: () => AsyncComponentLoader | AsyncComponentLoader | FunctionalComponent;
  parentId?: string;
  parent?: Node | null | boolean;
  children?: Node[];
  group: null | boolean;
  layout?: Layout;
  index: number;
  lock: boolean;
  type: 'temporaryGroup' | 'group' | 'node'
}
export type ComponentTree = Node[];
export interface NodeTreeState {
  [key: string]: any;
  // componentTree: ComponentTree;
  // root: Node;
  // activeNode: any;
  // activeNodeId: string | null;
  // nodeTreeMap: {
  //   [key: string]: Node;
  // };
  // to: Node | null;
  // from: Node | null;
  // pullMode: 'copy' | 'move' | 'false';
  // root: Node;
}
export type MoveMode =
  | 'move'
  | 'n-resize'
  | 's-resize'
  | 'e-resize'
  | 'w-resize'
  | 'ne-resize'
  | 'nw-resize'
  | 'se-resize'
  | 'sw-resize';
